home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / edit.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-30  |  5.8 KB  |  225 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. #include <graph.h>
  22.  
  23. #define GWAda_Version       "IV.1"
  24. #define AVL_MAX_GEN_PARS    6
  25. #define AVL_TOOL_FNAME        "avltool.mnu"
  26. #define AVL_TOOL_MAX        550
  27. #define AVL_TOOL_MAX_MENU    40
  28. #define AVL_MAX_UNITS       350
  29. #define AVL_MAX_NAME_SIZE   60
  30. #define AVL_MENU_ITEMS      10
  31. #define AVL_MAX_FILE_NAME   128
  32. #define AVL_MAX_WINDOWS     8
  33. #define AVL_MAX_LINEL       256
  34. #define AVL_MAX_COLORS      16
  35. #define AVL_FN_OPTIONS      "GWAda.opt"
  36. #define AVL_DEFAULT_LIB     "MyLib"
  37. #define AVL_TEXT_COLOR      15  /* White */
  38. #define AVL_TEXT_BK_COLOR   1   /* Blue */
  39. #define AVL_WIND_COLOR      15  /* White */
  40. #define AVL_WIND_BK_COLOR   7   /* Gray */
  41. #define AVL_WIND_TITLE      11  /* Light blue */
  42. #define AVL_QUES_COLOR      1   /* Blue */
  43. #define AVL_QUES_BK_COLOR   7   /* Gray */
  44. #define AVL_PROM_COLOR      15  /* White */
  45. #define AVL_PROM_BK_COLOR   0   /* Black */
  46. #define AVL_MENU_READY      4   /* Red */
  47. #define AVL_MENU_LETTER     1   /* Blue */
  48. #define AVL_MENU_WORD       9   /* light blue */
  49. #define AVL_MENU_BK_COLOR   7   /* Gray */
  50. #define AVL_ERRO_COLOR      4   /* red */
  51. #define AVL_STAT_BK_COLOR   AVL_TEXT_BK_COLOR
  52. #define AVL_STAT_COLOR      11
  53. #define AVL_MESG_COLOR      1
  54. #define AVL_MESG_BK_COLOR   4
  55. #define AVL_NO_COLORS_OPTS  18
  56. #define avl_video_base_address  0xB8000
  57. #define AVL_MAP(r,c)  ((short *) (avl_video_base_address + (r - 1) * 160 + (c - 1) * 2))
  58. #define AVL_PUT(ch,r,c,bk,cor) *AVL_MAP(r,c) = ((char) ch) | ((short) (((bk << 4) | cor) << 8))
  59. #define AVL_ATT(r,c) ((char) ((AVL_MAP(r,c)) >> 8))
  60. #define AVL_CH(r,c)  ((char) *AVL_MAP(r,c))
  61.  
  62.  
  63. typedef    struct {
  64.         char st;
  65.         char name[AVL_MAX_NAME_SIZE + 1];
  66.         } *AVL_BIND_PTR, AVL_BIND_SIZE;
  67.  
  68.  
  69.  
  70. typedef struct {
  71.         char status;
  72.         char is_main;
  73.         char cdate[5];
  74.         char fu[AVL_MAX_NAME_SIZE + 1];
  75.         } AVL_UNIT_DATA;
  76.  
  77. typedef struct {
  78.     AVL_UNIT_DATA s[AVL_MAX_UNITS];
  79.     int ns; 
  80.     } *AVL_UNITDT_PTR, AVL_UNITDT;
  81.  
  82. typedef struct {
  83.     char sources[AVL_MAX_NAME_SIZE + 1];
  84.     char library[AVL_MAX_NAME_SIZE + 1];
  85.     int tabsize;
  86.  
  87.     short avl_heap;
  88.     short avl_pgm_stack;
  89.     short avl_task_stack;
  90.     short avl_scheduller;
  91.     char  avl_trace_opts[6];
  92.         
  93.     short avl_txt_color;
  94.     short avl_txt_bk_color;
  95.     short avl_wnd_color;
  96.     short avl_wnd_title;
  97.     short avl_wnd_bk_color;
  98.     short avl_que_color;
  99.     short avl_que_bk_color;
  100.     short avl_pro_color;
  101.     short avl_pro_bk_color;
  102.     short avl_men_ready;
  103.     short avl_men_letter;
  104.     short avl_men_word;
  105.     short avl_men_bk_color;
  106.     short avl_err_color;
  107.     short avl_sta_color;
  108.     short avl_sta_bk_color;
  109.     short avl_msg_color;
  110.     short avl_msg_bk_color;
  111.     char  avl_monitor_on;
  112.     } AVL_OPTIONS;
  113.  
  114. typedef struct line_node {
  115.     char line[AVL_MAX_LINEL + 1];
  116.     int  line_no;
  117.     char line_attrib;
  118.     struct line_node *previous;
  119.     struct line_node *next;
  120.     } AVL_LINE_SIZE, *AVL_LINE_PTR;
  121.  
  122. typedef struct {
  123.     char video[4000];
  124.     long bk;
  125.     short co;
  126.     short r1, c1, r2, c2;
  127.     struct rccoord pos;
  128.     } AVL_WIN_SIZE, *AVL_WIN_PTR;
  129.  
  130. typedef void (*PROC_NAME)();
  131.  
  132. typedef struct node {
  133.     char file_name[AVL_MAX_FILE_NAME+1];
  134.     long buffer_size;
  135.     short r1, c1,  /*  upper-left corner of window  */
  136.           r2, c2;  /*  lower-right corner of window */
  137.     int txt_col;
  138.     int scr_col;
  139.     int scr_row;
  140.     int offset;
  141.     char no_status;
  142.     char changed;
  143.     int tabsize;
  144.     int no_errors;
  145.     int line_no; /*  where error was found  */
  146.     int txt_pos; /*  where editing and scanning is in  */
  147.     AVL_LINE_PTR head;
  148.     AVL_LINE_PTR current_line;
  149.     char expanded_line[1025];
  150.     char edit_mode;
  151.     AVL_WIN_SIZE sw;
  152.     struct node *avl_w;
  153.     AVL_WIN_PTR avl_win1;
  154.     PROC_NAME fix;
  155.     PROC_NAME insert;
  156.     PROC_NAME options;
  157.     PROC_NAME delete;
  158.     PROC_NAME error;
  159.     struct node *previous, *next;
  160.     }  AVL_EDIT_WINDOW, *AVL_EDIT_WINDOW_PTR;
  161.  
  162. typedef struct {
  163.     short r, c;
  164.     char *tit;
  165.     } AVL_TIT;
  166.  
  167.  
  168. typedef struct {
  169.     short ret_edit;
  170.     char *sm;
  171.     PROC_NAME proc;
  172.     } AVL_SMENU_SEL;
  173.     
  174. typedef struct {
  175.     int r, c;
  176.     AVL_SMENU_SEL s[23];
  177.     } AVL_STIT;
  178.  
  179.  
  180. typedef struct {
  181.     short isbk;
  182.     char *where;
  183.     short *who;
  184.     } AVL_COLOR_CHOICES;
  185.  
  186.  
  187. typedef struct {
  188.     char menu_item[AVL_TOOL_MAX_MENU+1];
  189.     char source[AVL_MAX_FILE_NAME+1]; 
  190.     } *AVL_MENU_PTR, AVL_MENU_SIZE;
  191.  
  192. typedef struct {
  193.     AVL_MENU_SIZE menu[AVL_TOOL_MAX];
  194.     int no_menu;
  195.     } *AVL_TOOL_PTR, AVL_TOOL_SIZE;
  196.  
  197.  
  198. typedef struct {
  199.     char  type; /* I = generic unit S = Source code ... */
  200.     char  pname  [AVL_MAX_LINEL + 1];
  201.     char  help   [AVL_MAX_FILE_NAME+1];
  202.     char  with   [AVL_MAX_LINEL + 1];
  203.     char  package[AVL_MAX_LINEL + 1];
  204.     char  gen_pars[AVL_MAX_GEN_PARS][AVL_MAX_LINEL + 1];
  205.     short n_pars;
  206.     } *AVL_T_MENU_PTR, AVL_T_MENU_SIZE;
  207.  
  208. typedef struct {
  209.     AVL_MENU_SIZE menu[AVL_TOOL_MAX];
  210.     AVL_T_MENU_SIZE more[AVL_TOOL_MAX];
  211.     int no_menu;
  212.     } *AVL_T_TOOL_PTR, AVL_T_TOOL_SIZE;
  213.  
  214. typedef void (*PROC_TOOL)(AVL_T_TOOL_PTR t);
  215.  
  216. typedef struct {
  217.     char *tool_opt;
  218.     PROC_TOOL proc;
  219.     } TOOL_SIZE;
  220.  
  221.  
  222. typedef struct {
  223.     char name[AVL_TOOL_MAX][13];
  224.     int no_files;
  225.     } AVL_SOURCE_SIZE, *AVL_SOURCE_PTR;
  226.